#!/bin/bash
#file_flag="./config/VersionFlag"
path="/my-demo/oxc"
file_flag="./config/VersionFlag"
v1="./oxcV1.bin"
v2="./oxcV2.bin"

cd "$path"

if [ ! -f "$file_flag" ] 
then
    if [ -f "$v1" ] 
    then
        $v1 &
    elif [ -f "$v2" ] 
    then
        touch "$file_flag"
        $v2 &        
    else 
        exit 0
    fi            
else 
    if [ -f "$v2" ]
    then
        $v2 &
    elif [ -f "$v1" ]
    then
        rm -f "$file_flag"
        $v1 &     
    else 
        exit 0
    fi        
fi